import React, { Component } from 'react'
import IndexRouter from './router/IndexRouter'
import Tabbar from './components/Tabbar'
import store from './redux/store'

export default class App extends Component {
    state = {
        isShow: true
    }
    componentDidMount() {
        store.subscribe(
            () => {
                this.setState({ isShow: store.getState().TabbarReducer.show })
            }
        )
    }

    render() {
        return (
            <div>
                <IndexRouter>
                    {this.state.isShow && <Tabbar />}
                </IndexRouter>
            </div>
        )
    }
}
